// @mxmlc -debug=true -library-path+=lib -includes com.guavestudios.fcon.ConsoleImpl com.guavestudios.fcon.commands.HelpCommand com.guavestudios.fcon.commands.TransparentCommand
/**
* @author maze | guavestudios.com
* @license MIT License see LICENSE.TXT
* @version 0.1
*/

package {
	import com.guavestudios.fcon.ConsoleImpl;
	import flash.display.*;
	import com.guavestudios.fcon.commands.HelpCommand;
	import flash.events.KeyboardEvent;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	[SWF(width="800",height="400",backgroundColor='0xffffff',frameRate='30')]
	public class ConsoleTest extends Sprite{
		
		public var txt:TextField = new TextField();
		public function ConsoleTest() {
			stage.align=StageAlign.TOP_LEFT;
			stage.scaleMode=StageScaleMode.NO_SCALE;
			ConsoleImpl;
			var config:XML=
				<settings>
					<setting id="Console.OpenKey1">here</setting>
					<setting id="Console.OpenKey"><![CDATA[crtl+Char.<]]></setting>
					<setting id="Console.trace">false</setting>
					<setting id="AutoCompletion.Key"><![CDATA[Char.<]]></setting>
					<setting id="HistoryManager.SaveHistory">true</setting>
					<setting id="Script.SaveScript">true</setting>
				</settings>;
					//<setting id="LockManager.password">fc653f99a1f3b34f9724b3a4fff1fc59b2e064177c880138bd2178cb3ac32181</setting>
			//<command>loadCommand com.guavestudios.fcon.commands.HelpCommand</command>
			//Console.setStage(this.stage,config);
			Console.setStage(stage, config);
			//Console.setStage(stage);
			
			Console.execute(["loadCommand", new HelpCommand()]);
			//Console.execute("const ATEST hallo");

			var s:Sprite=new Sprite();
			s.name="appchild";
			this.addChild(s);
			
			s=new Sprite();
			s.name="appchild1";
			this.addChild(s);
			
			s=new Sprite();
			s.name="childelse";
			this.addChild(s);
			stage.addEventListener(KeyboardEvent.KEY_UP, this_up);
			
			txt = new TextField();
			txt.autoSize = TextFieldAutoSize.LEFT;
			addChild(txt);
			txt.name = "txt";
			txt.y = 300;
		}
		
		private function this_up(e:KeyboardEvent):void {
			//trace("key: "+e.keyCode+", char: "+e.charCode+", crtl: "+ e.ctrlKey);
		}
		public function getString():String
		{
			return "returnString";
		}
		public function getNothing():void
		{
			
		}
		public function getObject():DisplayObject
		{
			return this;
		}
		public function getNull():DisplayObject
		{
			return null;
		}
	}
	
}
